package com.erp.remote.information;

import com.erp.entity.information.ClientCategory;
import com.erp.util.AjaxResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

@RequestMapping("/information/clientCategory")
public interface ClientCategoryRemote {

    @RequestMapping("/allCategory")
    AjaxResult getAllClientCategory();

    @PostMapping("/selectClientCategoryByCompanyId")
    AjaxResult selectClientCategoryByCompanyId(@RequestParam("companyId") Integer companyId);

    @PostMapping("/selectClientCategoryByCompanyIdPage")
    AjaxResult selectClientCategoryByCompanyIdPage(@RequestBody Map<String, Object> params);

    /**
     * 根据客户分类的的名称查询数据，含companyId
     * @param params
     * @return
     */
    @RequestMapping("/getClientCategoryByDescription")
    AjaxResult getClientCategoryByDescription(@RequestBody Map<String,Object> params);


    /**
     * 修改时选择可用的父类别
     * @param companyId
     * @return
     */
    @PostMapping("/selectAvailableParentCategories")
    AjaxResult selectAvailableParentCategories(@RequestParam("currentId") Integer currentId, @RequestParam("companyId") Integer companyId);
    /**
     * 添加用户类别
     * @param clientCategory
     * @return
     */
    @PostMapping("/addClientCategory")
   AjaxResult addClientCategory(@RequestBody ClientCategory clientCategory);


    @RequestMapping("/checkClientCategoryOnly")
    AjaxResult checkClientCategoryOnly(@RequestParam("clientCategoryCode") String clientCategoryCode);


    /**
     * 启用客户分类
     * @param params
     * @return
     */
    @PostMapping("/enableClientCategory")
    AjaxResult enableClientCategory(@RequestBody Map<String,Object> params);

    /**
     * 禁用客户分类
     * @param params
     * @return
     */
    @PostMapping("/disableClientCategory")
    AjaxResult disableClientCategory(@RequestBody Map<String,Object> params);

    @PostMapping("/updateClientCategory")
    AjaxResult updateClientCategory(@RequestBody ClientCategory clientCategory);
}
